Skip to content

Feat: From schema.prisma to sql files - #2

Merged
VoidClancy merged 1 commit into
masterfrom
Migration-Dialect
Jun 27, 2026
Merged

Feat: From schema.prisma to sql files#2
VoidClancy merged 1 commit into
masterfrom
Migration-Dialect

Conversation

@VoidClancy

Copy link
Copy Markdown
Owner

1- refactor the providers into its own package to use in schema and migration packages (might be a part of global enums later)

2-add validateRelation() to the resolver to ensure type consistency in the relations, and the count of FKs and Ref fields

3-add 4 more funcs to the Dialect interface (generateEnum, FormatAutoInc, FormatSinglePk, FormatEnumConstraint), and implement each one in the pgDialect and sqliteDialect

4-define then modulize generateTables() and generateEnums(), takes ASTs and generates full Up migration tables (will refactor the props in a struct), modulized into many helpers, each one with it's own responsibility

5- define DropTables() and DropEnums() to generate the SQL for dropping in goose

6- define 3 facades, GenerateUpMigrations(), which generates tables and enums, returns the up migration. GenerateDownMigration(), which returns the down SQL string, and finally the GenerateMigration() which put it all together into a goose-complient fashion because that's what im gonna use under the hood

7- test file in migration package is Claude trying to break my implementation and it passed so i'll take the win

1- refactor the providers into its own package to use in schema and migration packages (might be a part of global enums later)

2-add validateRelation() to the resolver to ensure type consistency in the relations, and the count of FKs and Ref fields

3-add 4 more funcs to the Dialect interface (generateEnum, FormatAutoInc, FormatSinglePk, FormatEnumConstraint), and implement each one in the pgDialect and sqliteDialect

4-define then modulize generateTables() and generateEnums(), takes ASTs and generates full Up migration tables (will refactor the props in a struct), modulized into many helpers, each one with it's own responsibility

5- define DropTables() and DropEnums() to generate the SQL for dropping in goose

6- define 3 facades, GenerateUpMigrations(), which generates tables and enums, returns the up migration. GenerateDownMigration(), which returns the down SQL string, and finally the GenerateMigration() which put it all together into a goose-complient fashion
because that's what im gonna use under the hood

7- test file in migration package is Claude trying to break my implementation and it passed so i'll take the win
@VoidClancy VoidClancy self-assigned this Jun 27, 2026
@VoidClancy
VoidClancy merged commit cf8e884 into master Jun 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant